package com.ljj.dolls;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Dolls<V> {

    private Map<Object,Object> map=new ConcurrentHashMap<>();

    public void put(Object key,V value){
        map.put(key,value);
    }
    public Dolls putDolls(Object key){
        Dolls res=(Dolls) map.putIfAbsent(key,new Dolls());
        if(res==null){
            res=(Dolls) map.get(key);
        }
        return res;
    }

    public Dolls getDolls(Object key){
        return (Dolls) map.get(key);
    }

    public V get(Object key){
        return (V)map.get(key);
    }

}
